package com.forenow.demo2;

public class Point {
    int x;
    int y;

    public int getX() {
        return x;
    }

    public void setX(int x) {
        this.x = x;
    }

    public int getY() {
        return y;
    }

    public void setY(int y) {
        this.y = y;
    }

    public Point(){
        this.x=10;
        this.y=10;
    }
    public Point(int x0,int y0){
        this.x=x0;
        this.y=y0;
    }
    public void movePoint(int dx,int dy){
        this.x+=dx;
        this.y+=dy;
    }

    public static void main(String[] args) {
        Point p1=new Point();
        Point p2 = new Point(5,6);
        p1.movePoint(10,20);
        System.out.println("p1的移动坐标为"+"("+p1.getX()+","+p1.getY()+")");
        p2.movePoint(29,29);
        System.out.println("p2的移动坐标为"+"("+p2.getX()+","+p2.getY()+")");

    }
}
